package com.zfskkk.demoprovider;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotEmpty;

/**
 * 自定义配置文件读取方式
 *
 * @author zhangfoshou
 * @date 2019/2/13 11:50
 */
@ConfigurationProperties(prefix = "config")
@PropertySource(value = "classpath:config.properties")
@Component
@Data
public class Config {
    @NotEmpty
    private String ip;
    private String port;
}
